package com.salim.leetcode.$70;

public class ClimbingStairs {
    public int climbStairs(int n) {
        if(n<=2){
            return n;
        }
        int[] array = new int[n];
        array[0] = 1;
        array[1] = 2;
        for (int i=2;i<n;i++){
            array[i] = array[i-2]+array[i-1];
        }
        return array[n-1];
    }
}
